    //account
    var $tab = $('ul.tab');
    if ($tab.length) {
        var content = $tab.next('div');
        var search = window.location.search.toString().substr(1).split('&');
        var type = 0;
        for(var i=0;i<search.length;i++){
            search[i] = search[i].split('=');
            if(search[i][0] == 'type'){
                type = search[i][1];
            }
        }
        var J_profile =  $('div.profile');
        $tab.find(">li").bind('click', function(e) {
            e.preventDefault();
            $(this).addClass('cur').siblings('.cur').removeClass();
            var index = $tab.find(">li").index($(this));
            content.find('>div').css('display','none');
            content.find('>div').eq(index).show().css('display','block');
            if(content.find('>div').eq(index).hasClass('profile')){
            	content.find('>div').eq(index).css('marginTop','0');
            }else{
            	content.find('.profile').css('marginTop','-99999px');
            }

        });
        if(type){
            $tab.find(">li").eq(type).trigger('click');
        }
    }
$(function() {
    var $J_history = $("#J_history");

    //判断浏览器是否支持某css3样式
    var supports = (function() {
        var div = document.createElement('div'),
                vendors = 'Khtml O Moz Webkit'.split(' '),
                len = vendors.length;
        return function(prop) {
        	if(window.ActiveXObject && parseInt(navigator.userAgent.toLowerCase().match(/msie ([\d.]+)/)[1],10) <= 8 ) {
                return false;
            }	
            if (prop in div.style)
                return true;
            if ('-ms-' + prop in div.style)
                return true;
            prop = prop.replace(/^[a-z]/, function(val) {
                return val.toUpperCase();
            });
            while (len--) {
                if (vendors[len] + prop in div.style) {
                    return true;
                }
            }
            return false;
        };
    })();
    $('.ucenter-pic').hover(function() {
        $(this).find('div,a ').css('display', 'block');
    }, function() {
        $(this).find('div,a ').css('display', 'none');
    })
    var supportsTransition = supports('transition');
    if (!supportsTransition) {
        $("#J_plist li").hover(function() {
            var _el = $(this).find('.transition');
            _el.data('history_hover', _el.data('history_hover') == true ? false : true);
            _el.stop().animate({
                opacity: !_el.data('history_hover') ? 0.5 : 1
            }, 300);
        });
    }
    $J_history.find('>a').hover(function() {
        var _el = $J_history.find('>div.' + $(this).attr('class'));
        if (supportsTransition) {
            _el.toggleClass('history_hover');
        } else {
            _el.data('history_hover', _el.data('history_hover') == true ? false : true);
            _el.stop().animate({
                opacity: !_el.data('history_hover') ? 0.5 : 1
            }, 300);

        }
    }).bind('click', function(e) {
        e.preventDefault();
        animateUi($(this).attr('class') == 'history-right', $(this));
    });

    var animateUl = $J_history.find('>ul');
    var page = 1, pageLen = 5, itemLen = animateUl.find('>li').length, itemWidth = 150, pageWidth = itemWidth * pageLen;
    var maxPage = Math.ceil(itemLen / pageLen);
    animateUl.width(itemWidth * itemLen).css('left', 0);
    function animateUi(direction) {
        if (!animateUl.is(":animated")) {//正在执行动画时候点击无效，以免添加过多animate队列
            //设置页数达到最大或最小返回
            page = direction ? page + 1 : page - 1;
            page = page > pageLen ? page = 1 : page;
            page = page == 0 ? maxPage : page;

            var animateTo = Math.max(-(page - 1) * pageWidth, -itemWidth * itemLen + pageWidth);
            var left = animateUl.position().left;
            var speed = Math.max(700, Math.abs(animateTo - left) / pageWidth * 700);//根据移动距离计算速度 最低700s
            animateUl.animate({
                left: animateTo + 'px'
            }, speed, 'swing');
        }
    }


    
    
    
    
    

    
    var supportsShadow = supports('boxShadow');
    var text_focus = supportsShadow == true ? 'text_focus' : 'text_focus text_focus_ie';
    $('input.text').focus(function() {
        if (!$(this).hasClass('text_error')) {
            $(this).addClass(text_focus);
        }
    }).blur(function() {
            $(this).removeClass(text_focus);
    });

    //弹出修改成功对话框
    function DlgAlert(str) {
        str = str || '修改成功';
        var $dlg = $("#J_alert").length ? $("#J_alert") : $('<div id="J_alert" class="alertDlg">'+ str +'</div>').appendTo(document.body);
        $dlg.css({
            left : ($(window).width() - 210)/2 + $(window).scrollLeft(),
            top  : ($(window).height() - 111)/2 + $(window).scrollTop()
        }).fadeIn();
        setTimeout(function(){
            $dlg.fadeOut();
        },2000);
    }
})